-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EventService CRUD methods #767
Add EventService CRUD methods #767
Conversation
Added the following: * Create event * Get event by ID * Update event * Delete event by ID
Visit the preview URL for this PR (updated for commit e6d0ec6): https://uasc-ceebc--pr767-702-backend-create-a-afv7s7ud.web.app (expires Sat, 07 Sep 2024 12:00:57 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 36296ceaed1d43e92e7d5e81a72a7bd987560bfa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some simple tests would be good
Removed document ID when fetching an event as realised was not needed. Man its the timestamps again...
Includes add, get, update and delete methods.
https://github.com/UoaWDCC/uasc-web into 702-backend-create-an-eventservice-for-crud-on-events
Added tests in EventService.test.ts for sub collection, EventReservation.
Seems to work in tests so didn't need to use DateUtil
…pdate event service Changed FirestoreCollections to 2 different collections: * FirestoreCollection - just the general collections * FirestoreSubcollection - collections under a "general" collection Created individual Firestore.ts file to hold the main adapter and have the subcollection and collection import it. Updated EventService for the subcollection changes.
The `deleteEvent` function from EventService will now delete all reservations if they exist. Added tests to test functionalities. 1. Tests deleting all reservations under a deleted event 2. Checks if other reservations are deleted that are unrelated to a deleted event
expect(fetchedReservation2).toBe(undefined) | ||
}) | ||
|
||
it("Should not delete other reservations when deleting an event document", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Added the following: